import { type IVxueColumnConfig, tableUtils } from '@/components/table'
import type { IAgentVersionEntity } from '@/types'

export interface AgentVersion extends IAgentVersionEntity {
  agentStatus: '0' | '1'
  publishRecord?: {
    updateTime: string
    createBy: string
    createTime: string
    agentJson: AgentJsonData[]
  }[]
}

export interface AgentJsonData {
  customerClientId: string
  customerName: string
  productionLineId: string
}

export interface SlotRow {
  row: AgentVersion
}

const columnConfig: IVxueColumnConfig<AgentVersion>[] = [
  {
    type: 'checkbox',
    width: 80
  },
  {
    field: 'agentVersion',
    title: '代理版本',
    width: 150
  },
  {
    field: 'description',
    title: '代理描述 '
  },
  {
    field: 'allowedVersion',
    title: '可升级版本',
    width: 150
  },
  {
    field: 'agentStatus',
    title: '代理状态',
    width: 100,
    slot: 'agentStatus'
  },
  // {
  //   field: 'publishRecord',
  //   title: '通知升级客户',
  //   width: 400,
  //   slot: 'publishRecord'
  // },
  // {
  //   field: 'publishRecord',
  //   title: '代理数',
  //   width: 100,
  //   slot: 'publishRecord'
  // },
  {
    field: 'createBy',
    title: '创建人 ',
    width: 150
  },
  {
    field: 'createTime',
    title: '创建时间',
    width: 150
  },
  {
    field: 'updateBy',
    title: '更新人',
    width: 150
  },
  {
    field: 'updateTime',
    title: '更新时间',
    width: 150
  }
]

tableUtils.setChecked(columnConfig)

export { columnConfig }
